﻿namespace EFCore反向工程
{
  internal class Program
  {
    static void Main(string[] args)
    {
      //从现有数据库表反向创建Model

      //通过命令反向 Scaffold-DbContext "Data Source=(localdb)\ProjectModels;Initial Catalog=EFCoreDemoDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False" Microsoft.EntityFrameworkCore.SqlServer
      using var sp = new EfcoreDemoDbContext();
     var a= sp.TPersons.GroupBy(a=>a.Salary).Count();

    }
  }
}
